
layui.use(['layer','laydate'], function(){
    componentSelectInit(
        {
            ctxPath:'',
            tableName:"wn_farm",
            showValueField:"name",
            valueField:"id",
            selectId:"farmId"  ,
            where:""
        }
        ,function(){
        });
});

var wnMachineDeviceConsoleGrid =new consoleGrid({table_id:"wnMachineDevice"});
wnMachineDeviceConsoleGrid.init();
function wnMachineDeviceTableOperate(value){
return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"wnMachineDevice\",\"/console/wn_machine_device/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
}
function wnMachineDeviceLoadParam(params){
params.query=wnMachineDeviceQueryString();
return params;
}
function wnMachineDeviceQueryString() {
var objQuery = new Object();
    objQuery.deviceNumber=$('#deviceNumber').val()==''?null:$('#deviceNumber').val(); 
     objQuery.deviceType=$('#deviceType').val()==''?null:$('#deviceType').val(); 
     objQuery.farmId=$('#farmId').val()==''?null:$('#farmId').val(); 
 
var queryString = JSON.stringify(objQuery);
return queryString;
}

